package com.jrsoft.bim;

import javafx.application.Application;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.Banner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class JrsoftBimApplication implements CommandLineRunner {

	@Value("${server.port}")
	public void setPort(String port) {
		ApplicationWebViewRunner.port = port;
	}

	@Value("${webview.launch:false}")
	public void setLaunch(boolean launch) {
		ApplicationWebViewRunner.launch = launch;
	}

	/**
	 * SpringBoot 的入口，这里关闭了启动时会出现的 banner 图形
	 * @param args 启动时输入的参数
	 */
	public static void main(String[] args) {
//		SpringApplication.run(JrsoftBimApplication.class, args);
		SpringApplication app = new SpringApplication(JrsoftBimApplication.class);
		app.setBannerMode(Banner.Mode.OFF);
		app.run(args);
	}

	/**
	 * SpringBoot 初始化完成后立即执行该方法，在这里制定窗体程序的入口类
	 *
	 * @param args 启动时输入的参数
	 */
	@Override
	public void run(String[] args) throws Exception {
		System.out.println("SpringBoot 桌面应用");
//		Application.launch(ApplicationWebViewRunner.class, args);
	}
}
